package data.bean;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Database Field Annotation.
 * A bean filed for database table field must be annotated with this.
 * 
 * @author chuxiaoyuan
 *
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface DatabaseField {

	/**
	 * Field name (Default not a field)
	 */
	public String name();
	
	/**
	 * The field type class
	 */
	public Class<?> type() default Object.class;
	
	/**
	 * Name for local variable (if not specified: the same as name()).
	 */
	public String localName() default "";
	
	/**
	 * Indicate if it is a primary key field.
	 */
	public boolean primaryKey() default false;
	
	/**
	 * Indicate if it is auto generated.
	 */
	public boolean autoGenerate() default false;
}
